package com.dao;

import com.util.dbUtil;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class bookDao {
    private static Statement statement=null;

    public  ResultSet queryAll() throws SQLException, ClassNotFoundException {
        statement = dbUtil.getStatement();
        String sql="select  *  from shopping.book";
        ResultSet resultSet = statement.executeQuery(sql);
        return resultSet;
    }


    public ResultSet queryOne(String bookid) throws SQLException, ClassNotFoundException {

        Statement statement = dbUtil.getStatement();
        String sql="select  * from  shopping.book where bookid="+bookid;
        ResultSet resultSet = statement.executeQuery(sql);
        return resultSet;
    }






}
